<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 strict//EN" "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<!-- Mirrored from bos.asmhackers.net/docs/floppy/snippet_10/dma.php by HTTrack Website Copier/3.x [XR&CO'2013], Tue, 07 Oct 2014 11:24:06 GMT -->
<head>

  <title>Shows the source of dma.inc</title>


</head>
<body> 

<br />

<div style="font-family: Courier New, sans-serif; font-size: 13px; margin: 5px; padding: 2px; background-color: #FFFFFF">

<br />
<span style="color: #808080">;----------------------------------------------------------;</span><br />
<span style="color: #808080">; BOS kernel &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Christoffer Bubach, 2004-2005. ;</span><br />
<span style="color: #808080">;----------------------------------------------------------;</span><br />
<span style="color: #808080">; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;</span><br />
<span style="color: #808080">; &nbsp; &nbsp;DMA transfer code. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;</span><br />
<span style="color: #808080">; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;</span><br />
<span style="color: #808080">;----------------------------------------------------------;</span><br />
<br />
<br />
<span style="color: #808080">;------------------------------------------;</span><br />
<span style="color: #808080">; &nbsp;Lookup table for DMA controller ports &nbsp; ;</span><br />
<span style="color: #808080">;------------------------------------------;</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dma_mask_reg</span><span style="color: #0000FF"> &nbsp; &nbsp;</span><span style="color: #000000">dw</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #008800">0x0A</span><span style="color: #0000FF">, </span><span style="color: #008800">0x0A</span><span style="color: #0000FF">, </span><span style="color: #008800">0x0A</span><span style="color: #0000FF">, </span><span style="color: #008800">0x0A</span><span style="color: #0000FF">, </span><span style="color: #008800">0xD4</span><span style="color: #0000FF">, </span><span style="color: #008800">0xD4</span><span style="color: #0000FF">, </span><span style="color: #008800">0xD4</span><span style="color: #0000FF">, </span><span style="color: #008800">0xD4</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dma_mode_reg</span><span style="color: #0000FF"> &nbsp; &nbsp;</span><span style="color: #000000">dw</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #008800">0x0B</span><span style="color: #0000FF">, </span><span style="color: #008800">0x0B</span><span style="color: #0000FF">, </span><span style="color: #008800">0x0B</span><span style="color: #0000FF">, </span><span style="color: #008800">0x0B</span><span style="color: #0000FF">, </span><span style="color: #008800">0xD6</span><span style="color: #0000FF">, </span><span style="color: #008800">0xD6</span><span style="color: #0000FF">, </span><span style="color: #008800">0xD6</span><span style="color: #0000FF">, </span><span style="color: #008800">0xD6</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dma_clear_reg</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #000000">dw</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #008800">0x0C</span><span style="color: #0000FF">, </span><span style="color: #008800">0x0C</span><span style="color: #0000FF">, </span><span style="color: #008800">0x0C</span><span style="color: #0000FF">, </span><span style="color: #008800">0x0C</span><span style="color: #0000FF">, </span><span style="color: #008800">0xD8</span><span style="color: #0000FF">, </span><span style="color: #008800">0xD8</span><span style="color: #0000FF">, </span><span style="color: #008800">0xD8</span><span style="color: #0000FF">, </span><span style="color: #008800">0xD8</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dma_page_port</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #000000">dw</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #008800">0x87</span><span style="color: #0000FF">, </span><span style="color: #008800">0x83</span><span style="color: #0000FF">, </span><span style="color: #008800">0x81</span><span style="color: #0000FF">, </span><span style="color: #008800">0x82</span><span style="color: #0000FF">, </span><span style="color: #008800">0x8F</span><span style="color: #0000FF">, </span><span style="color: #008800">0x8B</span><span style="color: #0000FF">, </span><span style="color: #008800">0x89</span><span style="color: #0000FF">, </span><span style="color: #008800">0x8A</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dma_addr_port</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #000000">dw</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #008800">0x00</span><span style="color: #0000FF">, </span><span style="color: #008800">0x02</span><span style="color: #0000FF">, </span><span style="color: #008800">0x04</span><span style="color: #0000FF">, </span><span style="color: #008800">0x06</span><span style="color: #0000FF">, </span><span style="color: #008800">0xC0</span><span style="color: #0000FF">, </span><span style="color: #008800">0xC4</span><span style="color: #0000FF">, </span><span style="color: #008800">0xC8</span><span style="color: #0000FF">, </span><span style="color: #008800">0xCC</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dma_count_port</span><span style="color: #0000FF"> &nbsp;</span><span style="color: #000000">dw</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #008800">0x01</span><span style="color: #0000FF">, </span><span style="color: #008800">0x03</span><span style="color: #0000FF">, </span><span style="color: #008800">0x05</span><span style="color: #0000FF">, </span><span style="color: #008800">0x07</span><span style="color: #0000FF">, </span><span style="color: #008800">0xC2</span><span style="color: #0000FF">, </span><span style="color: #008800">0xC6</span><span style="color: #0000FF">, </span><span style="color: #008800">0xCA</span><span style="color: #0000FF">, </span><span style="color: #008800">0xCE</span><br />
<br />
<br />
<span style="color: #808080">;-----------------------------------;</span><br />
<span style="color: #808080">; &nbsp; dma transfer &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;</span><br />
<span style="color: #808080">; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;</span><br />
<span style="color: #808080">; &nbsp;in: &nbsp;ecx = page:offset &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;</span><br />
<span style="color: #808080">; &nbsp; &nbsp; &nbsp; bl &nbsp;= channel &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;</span><br />
<span style="color: #808080">; &nbsp; &nbsp; &nbsp; bh &nbsp;= 1=read, 0=write &nbsp; &nbsp; &nbsp; ;</span><br />
<span style="color: #808080">; &nbsp; &nbsp; &nbsp; esi = count &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;</span><br />
<span style="color: #808080">; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;</span><br />
<span style="color: #808080">; &nbsp;out: nothing. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;</span><br />
<span style="color: #808080">;-----------------------------------;</span><br />
<span style="color: #000000">dma_transfer</span><span style="color: #0000FF">:</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">push</span><span style="color: #0000FF"> &nbsp; &nbsp;</span><span style="color: #000000">eax</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">push</span><span style="color: #0000FF"> &nbsp; &nbsp;</span><span style="color: #000000">edx</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">push</span><span style="color: #0000FF"> &nbsp; &nbsp;</span><span style="color: #000000">esi</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">cli</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">or</span><span style="color: #0000FF"> &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">bh</span><span style="color: #0000FF">, </span><span style="color: #000000">bh</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">jz</span><span style="color: #0000FF"> &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">.dont_read</span><br />
<br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">bh</span><span style="color: #0000FF">, </span><span style="color: #000000">bl</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">add</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">bh</span><span style="color: #0000FF">, </span><span style="color: #008800">0x48</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">jmp</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">.read</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">.dont_read</span><span style="color: #0000FF">:</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">bh</span><span style="color: #0000FF">, </span><span style="color: #000000">bl</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">add</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">bh</span><span style="color: #0000FF">, </span><span style="color: #008800">0x44</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">.read</span><span style="color: #0000FF">:</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">dec</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">esi</span><br />
<br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">movzx</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #000000">eax</span><span style="color: #0000FF">, </span><span style="color: #000000">bl</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">word</span><span style="color: #0000FF"> [(</span><span style="color: #000000">eax</span><span style="color: #0000FF">*</span><span style="color: #008800">2</span><span style="color: #0000FF">)+</span><span style="color: #000000">dma_mask_reg</span><span style="color: #0000FF">]</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">al</span><span style="color: #0000FF">, </span><span style="color: #000000">bl</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">or</span><span style="color: #0000FF"> &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">al</span><span style="color: #0000FF">, </span><span style="color: #008800">0x04</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">out</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">al</span><span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #808080">; disable the channel</span><br />
<br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">movzx</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #000000">eax</span><span style="color: #0000FF">, </span><span style="color: #000000">bl</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">word</span><span style="color: #0000FF"> [(</span><span style="color: #000000">eax</span><span style="color: #0000FF">*</span><span style="color: #008800">2</span><span style="color: #0000FF">)+</span><span style="color: #000000">dma_clear_reg</span><span style="color: #0000FF">]</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">al</span><span style="color: #0000FF">, </span><span style="color: #008800">0</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">out</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">al</span><span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #808080">; initialize flip-flop</span><br />
<br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">movzx</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #000000">eax</span><span style="color: #0000FF">, </span><span style="color: #000000">bl</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">word</span><span style="color: #0000FF"> [(</span><span style="color: #000000">eax</span><span style="color: #0000FF">*</span><span style="color: #008800">2</span><span style="color: #0000FF">)+</span><span style="color: #000000">dma_mode_reg</span><span style="color: #0000FF">]</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">al</span><span style="color: #0000FF">, </span><span style="color: #000000">bh</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">out</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">al</span><span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #808080">; set DMA mode</span><br />
<br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">movzx</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #000000">eax</span><span style="color: #0000FF">, </span><span style="color: #000000">bl</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">word</span><span style="color: #0000FF"> [(</span><span style="color: #000000">eax</span><span style="color: #0000FF">*</span><span style="color: #008800">2</span><span style="color: #0000FF">)+</span><span style="color: #000000">dma_addr_port</span><span style="color: #0000FF">]</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">al</span><span style="color: #0000FF">, </span><span style="color: #000000">cl</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">out</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">al</span><span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #808080">; write low offset part</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">al</span><span style="color: #0000FF">, </span><span style="color: #000000">ch</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">out</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">al</span><span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #808080">; and high offset part</span><br />
<br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">movzx</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #000000">eax</span><span style="color: #0000FF">, </span><span style="color: #000000">bl</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">word</span><span style="color: #0000FF"> [(</span><span style="color: #000000">eax</span><span style="color: #0000FF">*</span><span style="color: #008800">2</span><span style="color: #0000FF">)+</span><span style="color: #000000">dma_page_port</span><span style="color: #0000FF">]</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">eax</span><span style="color: #0000FF">, </span><span style="color: #000000">ecx</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">shr</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">eax</span><span style="color: #0000FF">, </span><span style="color: #008800">16</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">out</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">al</span><span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #808080">; write page.</span><br />
<br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">movzx</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #000000">eax</span><span style="color: #0000FF">, </span><span style="color: #000000">bl</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">word</span><span style="color: #0000FF"> [(</span><span style="color: #000000">eax</span><span style="color: #0000FF">*</span><span style="color: #008800">2</span><span style="color: #0000FF">)+</span><span style="color: #000000">dma_count_port</span><span style="color: #0000FF">]</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">eax</span><span style="color: #0000FF">, </span><span style="color: #000000">esi</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">out</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">al</span><span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #808080">; low count</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">al</span><span style="color: #0000FF">, </span><span style="color: #000000">ah</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">out</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">al</span><span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #808080">; high count</span><br />
<br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">movzx</span><span style="color: #0000FF"> &nbsp; </span><span style="color: #000000">eax</span><span style="color: #0000FF">, </span><span style="color: #000000">bl</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">word</span><span style="color: #0000FF"> [(</span><span style="color: #000000">eax</span><span style="color: #0000FF">*</span><span style="color: #008800">2</span><span style="color: #0000FF">)+</span><span style="color: #000000">dma_mask_reg</span><span style="color: #0000FF">]</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">mov</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">al</span><span style="color: #0000FF">, </span><span style="color: #000000">bl</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">out</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">dx</span><span style="color: #0000FF">, </span><span style="color: #000000">al</span><span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #808080">; enable channel</span><br />
<br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">sti</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">pop</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">esi</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">pop</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">edx</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">pop</span><span style="color: #0000FF"> &nbsp; &nbsp; </span><span style="color: #000000">eax</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #000000">ret</span><br />
<span style="color: #0000FF"> &nbsp; &nbsp;</span><br />

</div>

<br />

</body>

<!-- Mirrored from bos.asmhackers.net/docs/floppy/snippet_10/dma.php by HTTrack Website Copier/3.x [XR&CO'2013], Tue, 07 Oct 2014 11:24:06 GMT -->
</html>